scrolledwindow: Stop using scroll cursors
authorMatthias Clasen <mclasen@redhat.com>
Fri, 9 Apr 2021 12:26:09 +0000 (08:26 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 9 Apr 2021 12:26:09 +0000 (08:26 -0400)
We used to override cursor to use all-scroll while the
content is being scrolled. Unfortunately, there is several
problems with this:
- It is really only expected certain devices, and we don't
  have the device information on Wayland
- With the way cursor setting works in GTK4, non-NULL cursors
  of the content (eg the text views ibeam) win, making the
  scroll cursor not show up
- Under X11, we seem to miss scroll end events and then
  the scroll cursor gets stuck
Therefore, just remove this feature.

gtk/gtkscrolledwindow.c

index 40e285c77b3e02f27bc4bea62e661717eff73e20..35ca37ab724ed9d3ea54e2101ae37130247734c5 100644 (file)
@@ -401,9 +401,6 @@ static void     indicator_start_fade (Indicator *indicator,
 static void     indicator_set_over   (Indicator *indicator,
                                       gboolean   over);
 
-static void     install_scroll_cursor (GtkScrolledWindow *scrolled_window);
-static void     uninstall_scroll_cursor (GtkScrolledWindow *scrolled_window);
-
 static void scrolled_window_scroll (GtkScrolledWindow        *scrolled_window,
                                     double                    delta_x,
                                     double                    delta_y,
@@ -1335,10 +1332,7 @@ start_scroll_deceleration_cb (gpointer user_data)
   priv->scroll_events_overshoot_id = 0;
 
   if (!priv->deceleration_id)
-    {
-      uninstall_scroll_cursor (scrolled_window);
-      gtk_scrolled_window_start_deceleration (scrolled_window);
-    }
+    gtk_scrolled_window_start_deceleration (scrolled_window);
 
   return FALSE;
 }
@@ -1349,7 +1343,6 @@ scroll_controller_scroll_begin (GtkEventControllerScroll *scroll,
 {
   GtkScrolledWindowPrivate *priv = gtk_scrolled_window_get_instance_private (scrolled_window);
 
-  install_scroll_cursor (scrolled_window);
   priv->smooth_scroll = TRUE;
 }
 
@@ -1442,7 +1435,6 @@ scroll_controller_scroll_end (GtkEventControllerScroll *scroll,
   GtkScrolledWindowPrivate *priv = gtk_scrolled_window_get_instance_private (scrolled_window);
 
   priv->smooth_scroll = FALSE;
-  uninstall_scroll_cursor (scrolled_window);
 }
 
 static void
@@ -3184,18 +3176,6 @@ gtk_scrolled_window_allocate_scrollbar (GtkScrolledWindow *scrolled_window,
   *allocation = child_allocation;
 }
 
-static void
-install_scroll_cursor (GtkScrolledWindow *scrolled_window)
-{
-  gtk_widget_set_cursor_from_name (GTK_WIDGET (scrolled_window), "all-scroll");
-}
-
-static void
-uninstall_scroll_cursor (GtkScrolledWindow *scrolled_window)
-{
-  gtk_widget_set_cursor (GTK_WIDGET (scrolled_window), NULL);
-}
-
 static void
 _gtk_scrolled_window_set_adjustment_value (GtkScrolledWindow *scrolled_window,
                                            GtkAdjustment     *adjustment,